<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>

</head>
<body>
<form class="form-horizontal" role="form" id="form">
    <div class="form-group">
        <label for="saveUser" class="col-sm-2 control-label">是否保存用户名</label>
        <div class="col-sm-10">

            <div id="saveUser"  initValue="1" onchange="changeHandler" class="cc-CheckBox" data="{'id':1,'name':'是否保存用户名'}"  nameCn="是否保存用户名" required="true"   data-options=""   remark="由6-10位字母和数字组成"></div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input type="button" value="isValid" onclick="isValid()">
            <input type="button" value="getAddData" onclick="getAddData()">
            <input type="button" value="getEditData" onclick="getEditData()">
            <input type="button" value="getQueryData" onclick="getQueryData()">
            <input type="button" value="setValue" onclick="setValue()">
            <input type="button" value="getValue" onclick="getValue()">
        </div>
    </div>
</form>

<script type="text/javascript" src="/lib/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/lib/layer/layer.js"></script>

<script type="text/javascript" src="/lib/handlebars/handlebars-v4.0.5.js"></script>
<script type="text/javascript" src="/lib/handlebars/handlebars-extend.js"></script>

<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="/lib/bootstrap/js/bootstrap.min.js"></script>



<link async rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css"/>
<link async rel="stylesheet" href="/lib/materialdesign/css/materialdesignicons.min.css"/>
<link href="/lib/pretty/pretty.min.css" rel="stylesheet" />


<script type="text/javascript"  src="/lib/common/common.js"></script>

<link rel="stylesheet" href="/lib/lobibox/css/Lobibox.min.css">
<script src="/lib/lobibox/js/lobibox.min.js"></script>

<link type="text/css" href="/lib/component/css/cc.css" rel="stylesheet" />
<script type="text/javascript"  src="/lib/component/js/cc.js"></script>

<script type="text/javascript">
    function changeHandler(){
        alert(1)
    }


    function isValid(){
        var form = new _$.Form("#form");
        var flag = form.isValid();
        if(flag){
            alert(flag)
        }

    }
    function getAddData(){

        var form = new _$.Form("#form");
        var values = form.getAddData();
        alert(JSON.stringify(values))
    }
    function getEditData(){

        var form = new _$.Form("#form");
        var values = form.getEditData();
        alert(JSON.stringify(values))
    }
    function getQueryData(){
        var form = new _$.Form("#form");
        var values = form.getQueryData();
        alert(JSON.stringify(values))
    }

    function setValue(){
        var name = _$.getById("saveUser");
        name.setValue(1);
    }
    function getValue(){
        var name = _$.getById("saveUser");
        var str = name.getValue();
        alert(str)
    }

   $(function(){
       _$.parser.parse();
   })
</script>
</body>
</html>
